﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.Infrastructure;
using System.Data.Entity;

namespace IncrustacionLaboral.BussinessLogic.Base
{
    public abstract class BaseManager<T> where T:class
    {
        DbContext context;

        public BaseManager(DbContext context)
        {
            this.context = context;
        }

        public virtual void Add(T entity)
        {
            var entitySet = context.Set<T>();
            if (entitySet != null)
            {
                entitySet.Add(entity);
                context.SaveChanges();
            }
        }

    }
}
